package cn.com.dbappsecurity.service;

import java.util.List;
import javax.servlet.http.HttpSession;
import cn.com.dbappsecurity.entity.User;

public interface IUser {
	
	/**
	 * 插入一个用户
	 * @param name
	 * @param password
	 * @return
	 * @throws Exception
	 */
	public boolean insert(String name,String password)throws Exception;
	
	/**
	 * 根据ID删除用户
	 * @param id
	 * @return
	 * @throws Exception
	 */
	public boolean delete(Integer[] id)throws Exception;
	
	/**
	 * 用户登录
	 * @param session
	 * @param name
	 * @param password
	 * @return
	 * @throws Exception
	 */
	public boolean login(HttpSession session,String name,String password)throws Exception;
	
	/**
	 * 修改用户
	 * @param id
	 * @param name
	 * @param password
	 * @param loginTime
	 * @return
	 * @throws Exception
	 */
	public boolean update(int id,String name,String password,String loginTime)throws Exception;
	
	/**
	 * 用户查询
	 * @param name
	 * @param createTimeFrom
	 * @param createTimeTo
	 * @param loginTimeFrom
	 * @param loginTimeTo
	 * @param page
	 * @param rows
	 * @param sort
	 * @param order
	 * @return
	 * @throws Exception
	 */
	public List<User> search(String name,String createTimeFrom,String createTimeTo,
			String loginTimeFrom,String loginTimeTo,int page,int rows,String sort,String order)throws Exception;
	
	/**
	 * 用户查询总条数
	 * @param name
	 * @param createTimeFrom
	 * @param createTimeTo
	 * @param loginTimeFrom
	 * @param loginTimeTo
	 * @return
	 */
	public int searchCount(String name,String createTimeFrom,String createTimeTo,
			String loginTimeFrom,String loginTimeTo)throws Exception;
}
